﻿using System;
using System.Windows;
using MediaBrowser.Gui.ViewModels;
using MediaBrowser.Gui.Views;

namespace MediaBrowser.Gui.MvvmUtils.UI
{
    public class WindowAboutVisualizer : IWindowAboutVisualizer
    {
        public bool? Show()
        {
            WindowAbout a = new WindowAbout();
            a.Owner = Application.Current.MainWindow;

            EventHandler handler = null;
            handler = delegate
            {
                ((ViewModelBase)a.DataContext).RequestClose -= handler;
                a.Close();
            };
            ((ViewModelBase)a.DataContext).RequestClose += handler;

            return a.ShowDialogAnimated();
        }
    }
}
